package com.lengxf.design;

public class Player implements Observer {

    private String name;

    public Player(String name) {
        this.name = name;
    }

    @Override
    public String getName() {
        return name;
    }

    @Override
    public void setName(String name) {
        this.name = name;
    }

    @Override
    public void help() {
        System.out.println("坚持住," + this.name + "来救你了");
    }

    @Override
    public void beAttacked(AllControlCenter allControlCenter) {
        System.out.println(this.name + "被攻击...");
        allControlCenter.notifyObserver(this.name);
    }


}
